/**
 * @projectName study-note
 * @package Chain
 * @className Chain.General
 */
package Chain;

/**
 * General
 * @description 总经理
 * @author answer_wx
 * @date 2022/7/6 11:31
 * @version 1.0
 */
public class General extends AbstractManager {
    public General(String name) {
        super(name);
    }

    @Override
    public void requestAction(Request request) {
        if ("请假".equals(request.getType())) {
            System.out.println(String.format("%s：%s 天数%d被批准", name, request.getContent(), request.getNum()));
        }
        if ("加薪".equals(request.getType())) {
            if (request.getNum() < 500) {
                System.out.println(String.format("%s：%s 加薪%d被批准", name, request.getContent(), request.getNum()));
            } else {
                System.out.println(String.format("%s：%s 加薪%d驳回", name, request.getContent(), request.getNum()));
            }
        }

    }
}